const {
  Channel
} = require('../models/index') // 引入channel表
class ChannelService {
  async addChannel(channel) {
    return Channel.create(channel)
  }

  async getChannel() {
    return Channel.findAll()
  }

  async getChannelByName(name) {
    return Channel.findAll({
      where: {
        name: name
      }
    })
  }
}

module.exports = new ChannelService()